<!DOCTYPE html>
<html>
	<head>
		<base href="{$base_name}"/>
		<meta charset="utf-8" />
		<meta content="yes" name="apple-touch-fullscreen">
		<meta content="yes" name="apple-mobile-web-app-capable">
        <meta content="telephone=no,email=no" name="format-detection">
		<script type="text/javascript" src="libs/flexible_css.js"></script>
		<script type="text/javascript" src="libs/config.js"></script>
		<script type="text/javascript" src="libs/flexible.js"></script>
		<script type="text/javascript" src="libs/jquery-1.7.2.min.js"></script>
		<!-- <script type="text/javascript" src="js/class.js"></script> -->
		<link rel="stylesheet" type="text/css" href="css/class.css">
	</head>
	<body>
		<div id="container">
			<div id="tabs">
				<ul class="tab">
					
				</ul>
			</div>
		</div>
	</body>
</html>
<script> 
$(".tab li").live('click',function(){
	var page_id = $(this).attr('data-tab');
	//alert(page_id);
	$(".tab li").removeClass('cur');
	$(this).addClass('cur');
	$('[data-page]').removeClass('on');
	$('[data-page="'+page_id+'"]').addClass('on');
});
</script>
<script id="tabtpl" type="text/html">
{{# for(var i = 0, len = d.length; i < len; i++){ }}
<li class="{{ d[i].class_num }}" data-tab="{{ d[i].id }}">{{ d[i].title }}</li>
{{# } }}
</script>
<script id="pagetpl" type="text/html">
{{# for(var i = 0, len = d.length; i < len; i++){ }}
<div class="page {{ d[i].class_on }}" data-page="{{ d[i].id }}">
	<a href="{{ d[i].user_url }}" class="introduce">
		<img src="{{ d[i].photo }}" alt="" />
		<div class="introduce-detail">
			<p class="i-name"><span>{{ d[i].uname }}<span><strong>{{ d[i].type }}</strong></p>
			<p class="i-position">{{ d[i].career }}</p>
			<div>个人简介>></div>
		</div>
	</a>
	<div class="subscribe">
		<span>课程描述</span>
		<p>{{ d[i].content }}</p>
	</div>
	<a href="{{ d[i].paper_url }}" class="examination">进入课程</a>
	{{#  if(d[i].test_url != null){ }}
	<a href="{{ d[i].test_url }}" class="exam">参加考试</a>
	{{#  } }}
	
	<div class="tips">
		<p>考试通过后可解锁下一周课程。好好复习，加油哦！</p>
	</div>
</div>
{{# } }}
</script>
<script src="./layui/laytpl.js"></script>
<script>
function get_json_page(){
	$.getJSON(root+'/class/rookie_detail/?id='+id, function(data){
		
		var dt = data.data;
		
		var tabtpl = $('#tabtpl').html();
		laytpl(tabtpl).render(dt, function(html){
			$('.tab').append(html);
		});
		var pagetpl = $('#pagetpl').html();
		laytpl(pagetpl).render(dt, function(html){
			$('#tabs').append(html);
		});
		
	});
}

var cur_num = 0;
//取得id值

var id = {$id};
//删除所有li
$('.tab li').remove();
$('.page').remove();
get_json_page();

</script>
